import Vue from 'vue'
import Vuex from 'vuex'
import actions from '../actions/source'
import { UPDATE_SWITCH_SITE_STATUS, UPDATE_DATA_DICTCTIONARY } from '../mutation-types'
const localStorage = require('store')

Vue.use(Vuex)

const state = {
}

const mutations = {
  [UPDATE_DATA_DICTCTIONARY] (state, data) {
    state['data_dictionary'] = data
  },
  [UPDATE_SWITCH_SITE_STATUS] (state, status) {
    localStorage.set('switch_site', status === true ? 1 : 0)
    state['switch_site'] = status
  }
}

export default {
  state,
  mutations,
  actions
}
